package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.TSingleselchoiceMapper;
import com.ruoyi.project.system.domain.TSingleselchoice;
import com.ruoyi.project.system.service.ITSingleselchoiceService;

/**
 * 单选选项Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-05-14
 */
@Service
public class TSingleselchoiceServiceImpl implements ITSingleselchoiceService 
{
    @Autowired
    private TSingleselchoiceMapper tSingleselchoiceMapper;

    /**
     * 查询单选选项
     * 
     * @param choiceId 单选选项ID
     * @return 单选选项
     */
    @Override
    public TSingleselchoice selectTSingleselchoiceById(Integer choiceId)
    {
        return tSingleselchoiceMapper.selectTSingleselchoiceById(choiceId);
    }

    /**
     * 查询单选选项列表
     * 
     * @param tSingleselchoice 单选选项
     * @return 单选选项
     */
    @Override
    public List<TSingleselchoice> selectTSingleselchoiceList(TSingleselchoice tSingleselchoice)
    {
        return tSingleselchoiceMapper.selectTSingleselchoiceList(tSingleselchoice);
    }

    /**
     * 新增单选选项
     * 
     * @param tSingleselchoice 单选选项
     * @return 结果
     */
    @Override
    public int insertTSingleselchoice(TSingleselchoice tSingleselchoice)
    {
        tSingleselchoice.setCreateTime(DateUtils.getNowDate());
        return tSingleselchoiceMapper.insertTSingleselchoice(tSingleselchoice);
    }

    /**
     * 修改单选选项
     * 
     * @param tSingleselchoice 单选选项
     * @return 结果
     */
    @Override
    public int updateTSingleselchoice(TSingleselchoice tSingleselchoice)
    {
        return tSingleselchoiceMapper.updateTSingleselchoice(tSingleselchoice);
    }

    /**
     * 批量删除单选选项
     * 
     * @param choiceIds 需要删除的单选选项ID
     * @return 结果
     */
    @Override
    public int deleteTSingleselchoiceByIds(Integer[] choiceIds)
    {
        return tSingleselchoiceMapper.deleteTSingleselchoiceByIds(choiceIds);
    }

    /**
     * 删除单选选项信息
     * 
     * @param choiceId 单选选项ID
     * @return 结果
     */
    @Override
    public int deleteTSingleselchoiceById(Integer choiceId)
    {
        return tSingleselchoiceMapper.deleteTSingleselchoiceById(choiceId);
    }
}
